
#include <stdbool.h>

#include "hcpp_config.h"
#include "hcpp/ptp2_default.h"
//#include "host_boot.h"
//#include "hcpp/ptp2_port.h"
//
//static mac_address_t            default_mac                         = {   .addr = { PTP2_PORT_MAC_ADDRESS  } };
//static ipv4_address_t           default_ipv4                        = { { .addr = { PTP2_PORT_IPV4_ADDRESS } } };
//static ipv4_address_t           default_ipv4_gw                     = { { .addr = { PTP2_PORT_IPV4_GATEWAY } } };
//static ipv4_address_t           default_ipv4_netmask                = { { .addr = { PTP2_PORT_IPV4_NETMASK } } };
//
//static ptp2_clock_identity_t    default_clock_identity              = { .raw    = { PTP2_DEFAULT_DS_CLOCK_IDENTITY } };
//
//static ipv6_address_t           default_ipv6                        = { { .addr = { PTP2_PORT_IPV6_ADDRESS } } };
//
//static ipv4_address_t           default_multicast_ipv4_primary      = { { .addr   = { PTP2_PORT_MULTICAST_IPV4_PRIMARY_IP } } };
//static ipv4_address_t           default_multicast_ipv4_pdelay       = { { .addr   = { PTP2_PORT_MULTICAST_IPV4_PDELAY_IP  } } };
//static ipv6_address_t           default_multicast_ipv6_primary      = { { .addr16 = { PTP2_PORT_MULTICAST_IPV6_PRIMARY_IP } } };
//static ipv6_address_t           default_multicast_ipv6_pdelay       = { { .addr16 = { PTP2_PORT_MULTICAST_IPV6_PDELAY_IP  } } };
//
//static mac_address_t            default_multicast_mac_ipv4_primary  = { .addr = { PTP2_PORT_MULTICAST_IPV4_PRIMARY_MAC  } };
//static mac_address_t            default_multicast_mac_ipv4_pdelay   = { .addr = { PTP2_PORT_MULTICAST_IPV4_PDELAY_MAC   } };
//static mac_address_t            default_multicast_mac_ipv6_primary  = { .addr = { PTP2_PORT_MULTICAST_IPV6_PRIMARY_MAC  } };
//static mac_address_t            default_multicast_mac_ipv6_pdelay   = { .addr = { PTP2_PORT_MULTICAST_IPV6_PDELAY_MAC   } };
//static mac_address_t            default_multicast_mac_ether_primary = { .addr = { PTP2_PORT_MULTICAST_ETHER_PRIMARY_MAC } };
//static mac_address_t            default_multicast_mac_ether_pdelay  = { .addr = { PTP2_PORT_MULTICAST_ETHER_PDELAY_MAC  } };
//
//static ptp2_time_interval_t     default_time_inverval               = { .nanoseconds = PTP2_PORT_DS_PEER_MEAN_PATH_DELAY };


/*** ENET HAL ***************************************************************/
//uint32_t
//ptp2_default_enet_rx_delay(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_netw_itf_rx_delay_get();
//    }
//    return ENET_RX_DELAY;
//}
//
//uint32_t
//ptp2_default_enet_tx_delay(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_netw_itf_tx_delay_get();
//    }
//    return ENET_TX_DELAY;
//}
//
//
//uint32_t
//ptp2_default_enet_rx_delay_slave(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_netw_itf_rx_delay_slave_get();
//    }
//    return ENET_RX_DELAY_SLAVE;
//}
//
//uint32_t
//ptp2_default_enet_tx_delay_slave(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_netw_itf_tx_delay_slave_get();
//    }
//    return ENET_TX_DELAY_SLAVE;
//}
//
///*** SYSCONF HAL ************************************************************/
//bool
//ptp2_default_sysconf_delay_resp_to_all(void)
//{
//    return SYSCONF_DELAY_RESP_TO_ALL;
//}
//
///*** PROFILE ****************************************************************/
//ptp2_profile_t
//ptp2_default_profile(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_ptp_profile_get();
//    }
//    return PTP2_PROFILE;
//}
//
///*** PORT *******************************************************************/
//
//bool
//ptp2_default_port_ip_use_dhcp(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_dhcp_get();
//    }
//    return PTP2_PORT_IP_USE_DHCP;
//}
//
//bool
//ptp2_default_port_vlan_enabled(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_vlan_enable_get();
//    }
//    return PTP2_PORT_VLAN_ENABLE;
//}
//
//uint16_t
//ptp2_default_port_vlan_vid(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_vlan_vid_get(0);
//    }
//    return PTP2_PORT_VLAN_VID;
//}
//
//uint8_t
//ptp2_default_port_vlan_pcp(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_vlan_pcp_get();
//    }
//    return PTP2_PORT_VLAN_PCP;
//}
//
//
//ipv4_address_t *
//ptp2_default_port_ipv4_address(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_ipv4_get();
//    }
//    return &default_ipv4;
//}
//
//ipv4_address_t *
//ptp2_default_port_ipv4_gateway(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_ipv4_gw_get();
//    }
//    return &default_ipv4_gw;
//}
//
//ipv4_address_t *
//ptp2_default_port_ipv4_netmask(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_ipv4_netmask_get();
//    }
//    return &default_ipv4_netmask;
//}
//
//ipv6_address_t *
//ptp2_default_port_ipv6_address(void)
//{
//    return &default_ipv6;
//}
//
//mac_address_t *
//ptp2_default_port_mac_address(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        host_boot_mac_get(&default_mac);
//    }
//    return &default_mac;
//}
//
//ptp2_address_type_t
//ptp2_default_port_multicast_address_type(void)
//{
//    return PTP2_PORT_MULTICAST_ADDRESS_TYPE;
//}
//
//ipv4_address_t *
//ptp2_default_port_multicast_ipv4_primary_ip(void)
//{
//    return &default_multicast_ipv4_primary;
//}
//
//ipv4_address_t *
//ptp2_default_port_multicast_ipv4_pdelay_ip(void)
//{
//    return &default_multicast_ipv4_pdelay;
//}
//
//ipv6_address_t *
//ptp2_default_port_multicast_ipv6_primary_ip(void)
//{
//    return &default_multicast_ipv6_primary;
//}
//
//ipv6_address_t *
//ptp2_default_port_multicast_ipv6_pdelay_ip(void)
//{
//    return &default_multicast_ipv6_pdelay;
//}
//
//mac_address_t *
//ptp2_default_port_multicast_ipv4_primary_mac(void)
//{
//    return &default_multicast_mac_ipv4_primary;
//}
//
//mac_address_t *
//ptp2_default_port_multicast_ipv4_pdelay_mac(void)
//{
//    return &default_multicast_mac_ipv4_pdelay;
//}
//
//mac_address_t *
//ptp2_default_port_multicast_ipv6_primary_mac(void)
//{
//    return &default_multicast_mac_ipv6_primary;
//}
//
//mac_address_t *
//ptp2_default_port_multicast_ipv6_pdelay_mac(void)
//{
//    return &default_multicast_mac_ipv6_pdelay;
//}
//
//mac_address_t *
//ptp2_default_port_multicast_ether_primary_mac(void)
//{
//    return &default_multicast_mac_ether_primary;
//}
//
//mac_address_t *
//ptp2_default_port_multicast_ether_pdelay_mac(void)
//{
//    return &default_multicast_mac_ether_pdelay;
//}
//
//uint8_t
//ptp2_default_port_dscp_ptp_event(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_dscp_settings_get(dscp_ptp);
//    }
//    return PTP2_DSCP_PTP_EVENT;
//}
//
//uint8_t
//ptp2_default_port_dscp_ptp_general(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_dscp_settings_get(dscp_general);
//    }
//    return PTP2_DSCP_PTP_GENERAL;
//}
//
//
//
///*** DEFAULT DATASET ********************************************************/
//
//bool
//ptp2_default_default_ds_two_step_clock(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_two_step_clock_get();
//    }
//    return PTP2_DEFAULT_DS_TWO_STEP_CLOCK;
//}
//
//ptp2_clock_identity_t *
//ptp2_default_default_ds_clock_identity(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        host_boot_clock_identity_get(&default_clock_identity);
//    }
//    return &default_clock_identity;
//}
//
//uint8_t
//ptp2_default_default_ds_port_count(void)
//{
//    return PTP2_DEFAULT_DS_PORT_COUNT;
//}
//
//uint8_t
//ptp2_default_default_ds_clock_class(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_clock_class_get();
//    }
//    return PTP2_DEFAULT_DS_CLOCK_CLASS;
//}
//
//uint8_t
//ptp2_default_default_ds_clock_accuracy(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_clock_accuracy_get();
//    }
//    return PTP2_DEFAULT_DS_CLOCK_ACCURACY;
//}
//
//uint16_t
//ptp2_default_default_ds_clock_variance(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_clock_variance_get();
//    }
//    return PTP2_DEFAULT_DS_CLOCK_VARIANCE;
//}
//
//uint8_t
//ptp2_default_default_ds_priority1(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_priority1_get();
//    }
//    return PTP2_DEFAULT_DS_PRIORITY1;
//}
//
//uint8_t
//ptp2_default_default_ds_priority2(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_priority2_get();
//    }
//    return PTP2_DEFAULT_DS_PRIORITY2;
//}
//
//uint8_t
//ptp2_default_default_ds_domain_number(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_domain_number_get();
//    }
//    return PTP2_DEFAULT_DS_DOMAIN_NUMBER;
//}
//
//bool
//ptp2_default_default_ds_slave_only(void)
//{
//    return PTP2_DEFAULT_DS_SLAVE_ONLY;
//}
//
//bool
//ptp2_default_default_ds_unicast_mode(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_addressing_mode_get();
//    }
//    return PTP2_DEFAULT_DS_UNICAST_MODE;
//}
//
//bool
//ptp2_default_default_ds_signaling_enabled(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_signaling_enabled();
//    }
//    return PTP2_DEFAULT_DS_SIGNALING_ENABLED;
//}
//
///*** TIME PROPERTIES DATASET ************************************************/
//
//int16_t
//ptp2_default_time_properties_ds_current_utc_offset(void)
//{
//    return PTP2_TIME_PROPERTIES_DS_CURRENT_UTC_OFFSET;
//}
//
//bool
//ptp2_default_time_properties_ds_current_utc_offset_valid(void)
//{
//    return PTP2_TIME_PROPERTIES_DS_CURRENT_UTC_OFFSET_VALID;
//}
//
//bool
//ptp2_default_time_properties_ds_leap59(void)
//{
//    return PTP2_TIME_PROPERTIES_DS_LEAP59;
//}
//
//bool
//ptp2_default_time_properties_ds_leap61(void)
//{
//    return PTP2_TIME_PROPERTIES_DS_LEAP61;
//}
//
//bool
//ptp2_default_time_properties_ds_time_traceable(void)
//{
//    return PTP2_TIME_PROPERTIES_DS_TIME_TRACEABLE;
//}
//
//bool
//ptp2_default_time_properties_ds_frequency_traceable(void)
//{
//    return PTP2_TIME_PROPERTIES_DS_FREQUENCY_TRACEABLE;
//}
//
//bool
//ptp2_default_time_properties_ds_ptp_timescale(void)
//{
//    return PTP2_TIME_PROPERTIES_DS_PTP_TIMESCALE;
//}
//
//ptp2_time_source_t
//ptp2_default_time_properties_ds_time_source(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_time_source_get();
//    }
//    return PTP2_TIME_PROPERTIES_DS_TIME_SOURCE;
//}
//
//
///*** PORT DATASET ***********************************************************/
//
//uint16_t
//ptp2_default_port_ds_port_number(void)
//{
//    return PTP2_PORT_DS_PORT_NUMBER;
//}
//
//ptp2_port_state_t
//ptp2_default_port_ds_port_state(void)
//{
//    if (host_boot_has_written_boot_params()) {
//        return host_boot_port_state_get();
//    }
//    return PTP2_PORT_DS_PORT_STATE;
//}
//
//int8_t
//ptp2_default_port_ds_log_min_delay_req_interval(void)
//{
//    return PTP2_PORT_DS_LOG_MIN_DELAY_REQ_INTERVAL;
//}
//
//ptp2_time_interval_t *
//ptp2_default_port_ds_peer_mean_path_delay(void)
//{
//    return &default_time_inverval;
//}
//
//int8_t
//ptp2_default_port_ds_log_announce_interval(void)
//{
//    return PTP2_PORT_DS_LOG_ANNOUNCE_INTERVAL;
//}
//
//uint8_t
//ptp2_default_port_ds_announce_receipt_timeout(void)
//{
//    return PTP2_PORT_DS_ANNOUNCE_RECEIPT_TIMEOUT;
//}
//
//uint8_t
//ptp2_default_port_ds_foreign_master_threshold(void)
//{
//    return PTP2_PORT_DS_FOREIGN_MASTER_THRESHOLD;
//}
//
//uint8_t
//ptp2_default_port_ds_foreign_master_time_window(void)
//{
//    return PTP2_PORT_DS_FOREIGN_MASTER_TIME_WINDOW;
//}
//
//int8_t
//ptp2_default_port_ds_log_sync_interval(void)
//{
//    return PTP2_PORT_DS_LOG_SYNC_INTERVAL;
//}
//
//ptp2_delay_mechanism_t
//ptp2_default_port_ds_delay_mechanism(void)
//{
//    return PTP2_PORT_DS_DELAY_MECHANISM;
//}
//
//int8_t
//ptp2_default_port_ds_log_min_pdelay_req_interval(void)
//{
//    return PTP2_PORT_DS_LOG_MIN_PDELAY_REQ_INTERVAL;
//}
//
//uint8_t
//ptp2_default_port_ds_version_number(void)
//{
//    return PTP2_PORT_DS_VERSION_NUMBER;
//}
//
//bool
//ptp2_default_port_ds_alternate_master(void)
//{
//    return PTP2_PORT_DS_ALTERNATE_MASTER;
//}
//
//bool
//ptp2_default_port_ds_profile_specific1(void)
//{
//    return PTP2_PORT_DS_PROFILE_SPECIFIC1;
//}
//
//bool
//ptp2_default_port_ds_profile_specific2(void)
//{
//    return PTP2_PORT_DS_PROFILE_SPECIFIC2;
//}
//
//
///*** FOREIGN MASTER *********************************************************/
//
//uint32_t
//ptp2_default_announce_seq_nr_overflow_window_size(void)
//{
//    return PTP2_ANNOUNCE_SEQ_NR_OVERFLOW_WINDOW_SIZE;
//}
//
//
///*** NODE TABLE *************************************************************/
//
//uint32_t
//ptp2_default_node_table_lut_write_interval(void)
//{
//    return PTP2_NODE_TABLE_LUT_WRITE_INTERVAL;
//}
//
//uint32_t
//ptp2_default_node_table_check_lease_duration_interval(void)
//{
//    return PTP2_NODE_TABLE_CHECK_LEASE_DURATION_INTERVAL;
//}

/*** LOG ********************************************************************/

bool
ptp2_default_log(void)
{
    return PTP2_LOG;
}

ptp2_log_level_t
ptp2_default_log_level_master(void)
{
    return PTP2_LOG_LEVEL_MASTER;
}

ptp2_log_level_t
ptp2_default_log_level_log(void)
{
    return PTP2_LOG_LEVEL_LOG;
}

ptp2_log_level_t
ptp2_default_log_level_hal_enet(void)
{
    return PTP2_LOG_LEVEL_HAL_ENET;
}

ptp2_log_level_t
ptp2_default_log_level_hal_timer(void)
{
    return PTP2_LOG_LEVEL_HAL_TIMER;
}

ptp2_log_level_t
ptp2_default_log_level_hal_ptp_time(void)
{
    return PTP2_LOG_LEVEL_HAL_PTP_TIME;
}

ptp2_log_level_t
ptp2_default_log_level_hal_slavemgm(void)
{
    return PTP2_LOG_LEVEL_HAL_SLAVEMGM;
}


ptp2_log_level_t
ptp2_default_log_level_hal_sysconf(void)
{
    return PTP2_LOG_LEVEL_HAL_SYSCONF;
}

ptp2_log_level_t
ptp2_default_log_level_hal_tod(void)
{
    return PTP2_LOG_LEVEL_HAL_TOD;
}

ptp2_log_level_t
ptp2_default_log_level_hal_esmc(void)
{
    return PTP2_LOG_LEVEL_HAL_ESMC;
}

ptp2_log_level_t
ptp2_default_log_level_fsm(void)
{
    return PTP2_LOG_LEVEL_FSM;
}

ptp2_log_level_t
ptp2_default_log_level_port(void)
{
    return PTP2_LOG_LEVEL_PORT;
}

ptp2_log_level_t
ptp2_default_log_level_task(void)
{
    return PTP2_LOG_LEVEL_TASK;
}

ptp2_log_level_t
ptp2_default_log_level_task_queue(void)
{
    return PTP2_LOG_LEVEL_TASK_QUEUE;
}

ptp2_log_level_t
ptp2_default_log_level_packet_ethernet(void)
{
    return PTP2_LOG_LEVEL_PACKET_ETHERNET;
}

ptp2_log_level_t
ptp2_default_log_level_packet_arp(void)
{
    return PTP2_LOG_LEVEL_PACKET_ARP;
}

ptp2_log_level_t
ptp2_default_log_level_packet_ipv4(void)
{
    return PTP2_LOG_LEVEL_PACKET_IPV4;
}

ptp2_log_level_t
ptp2_default_log_level_packet_ipv6(void)
{
    return PTP2_LOG_LEVEL_PACKET_IPV6;
}

ptp2_log_level_t
ptp2_default_log_level_packet_icmp(void)
{
    return PTP2_LOG_LEVEL_PACKET_ICMP;
}

ptp2_log_level_t
ptp2_default_log_level_packet_udp(void)
{
    return PTP2_LOG_LEVEL_PACKET_UDP;
}

ptp2_log_level_t
ptp2_default_log_level_packet_ptp2(void)
{
    return PTP2_LOG_LEVEL_PACKET_PTP2;
}

ptp2_log_level_t
ptp2_default_log_level_packet_ptp2_signaling(void)
{
    return PTP2_LOG_LEVEL_PACKET_PTP2_SIGNALING;
}

ptp2_log_level_t
ptp2_default_log_level_packet_ptp2_announce(void)
{
    return PTP2_LOG_LEVEL_PACKET_PTP2_ANNOUNCE;
}

ptp2_log_level_t
ptp2_default_log_level_packet_analyzer(void)
{
    return PTP2_LOG_LEVEL_PACKET_ANALYZER;
}

ptp2_log_level_t
ptp2_default_log_level_packet_assembler(void)
{
    return PTP2_LOG_LEVEL_PACKET_ASSEMBLER;
}

ptp2_log_level_t
ptp2_default_log_level_ping_table(void)
{
    return PTP2_LOG_LEVEL_PING_TABLE;
}

ptp2_log_level_t
ptp2_default_log_level_arp_table(void)
{
    return PTP2_LOG_LEVEL_ARP_TABLE;
}

ptp2_log_level_t
ptp2_default_log_level_node_table(void)
{
    return PTP2_LOG_LEVEL_NODE_TABLE;
}

ptp2_log_level_t
ptp2_default_log_level_shadow_table(void)
{
    return PTP2_LOG_LEVEL_SHADOW_TABLE;
}

ptp2_log_level_t
ptp2_default_log_level_profile()
{
    return PTP2_LOG_LEVEL_PROFILE;
}

ptp2_log_level_t
ptp2_default_log_level_bmca(void)
{
    return PTP2_LOG_LEVEL_BMCA;
}

ptp2_log_level_t
ptp2_default_log_level_tod(void)
{
    return PTP2_LOG_LEVEL_TOD;
}

ptp2_log_level_t
ptp2_default_log_level_dataset_default(void)
{
    return PTP2_LOG_LEVEL_DATASET_DEFAULT;
}

ptp2_log_level_t
ptp2_default_log_level_dataset_current(void)
{
    return PTP2_LOG_LEVEL_DATASET_CURRENT;
}

ptp2_log_level_t
ptp2_default_log_level_dataset_parent(void)
{
    return PTP2_LOG_LEVEL_DATASET_PARENT;
}

ptp2_log_level_t
ptp2_default_log_level_dataset_timeprop(void)
{
    return PTP2_LOG_LEVEL_DATASET_TIMEPROP;
}

ptp2_log_level_t
ptp2_default_log_level_dataset_port(void)
{
    return PTP2_LOG_LEVEL_DATASET_PORT;
}

ptp2_log_level_t
ptp2_default_log_level_dataset_foreign_master(void)
{
    return PTP2_LOG_LEVEL_DATASET_FOREIGN_MASTER;
}

ptp2_log_level_t
ptp2_default_log_level_spi_master(void)
{
    return PTP2_LOG_LEVEL_SPI_MASTER;
}


ptp2_log_level_t
ptp2_default_log_level_spi_slave(void)
{
    return PTP2_LOG_LEVEL_SPI_SLAVE;
}

ptp2_log_level_t
ptp2_default_log_level_pps_pll(void)
{
    return PTP2_LOG_LEVEL_PPS_PLL;
}
